package com.df.bpm.utils.businessViewer.outputsDialogServices;

import com.df.bpm.dto.BusinessOutputDTO;
import com.df.bpm.utils.businessViewer.Main;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.util.List;

public class BusinessOutputDTOservice {
    public List<BusinessOutputDTO> getList4Like(BusinessOutputDTO temp) {
        RestTemplate restTemplate = new RestTemplate();
        String url=Main.server+"businessOutputDTO/getList4Like";
        HttpEntity<BusinessOutputDTO> request = new HttpEntity<>(temp, null);
        ResponseEntity<List<BusinessOutputDTO>> response = restTemplate.exchange(
                url,
                HttpMethod.POST,
                request, // 或者使用 HttpEntity 来添加请求头等信息
                new ParameterizedTypeReference<List<BusinessOutputDTO>>() {}
        );
        return response.getBody();
    }
}
